class stack_queue(object):
    def __init__(self, stack1=None, stack2=None):
        self.stack1 = []
        self.stack2 = []


    def add_tail(self, x):
        self.stack1.append(x)


    def del_head(self):
        while self.stack2:
            self.stack2.pop()
        while self.stack1:
            self.stack2.append(self.stack1.pop())
        head = self.stack2.pop()
        while self.stack2:
            self.stack1.append(self.stack2.pop())
        return head


if __name__ == '__main__':
    quene = stack_queue()
    quene.add_tail(3)
    quene.add_tail(2)
    quene.add_tail(1)
    print(quene.del_head())